// Copyright (c) [Year] [name of copyright holder]
// [Software Name] is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2. 
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2 
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
// See the Mulan PSL v2 for more details.

/*!
 * \autor captainpeng
 * \date 2018-9-5
 * \update 2019-12-17
 * \version 1.0
 * \copyright
 */

#ifndef MY_RECORD_HPP
#define MY_RECORD_HPP

#include"mystd.hpp"

namespace my{

    class record{
        using intType = typename cint<64>::intType;
        using realType = double;
        using ptType = void *;

        union{
            intType mInt;
            realType mReal;
            ptType mPt;
        };

        intType & getInt(){
            return mInt;
        }

        realType & getReal(){
            return mReal;
        }

        template<typename T>
        T & getRef(){
            return *(T *)mPt;
        }
    };
}

#endif
